<%@ page language="java" pageEncoding="utf-8"%>
<%@taglib uri="/WEB-INF/page-base.tld" prefix="p"%>
<%String path=request.getContextPath(); %>

<script>
function rank_rankgroupok(){
	var nodes=$("#rankgroup_tree").dynatree("getTree").getSelectedNodes();
    	var nodestr="";
	for(i=0;i<nodes.length;i++){
		if(nodestr!="")
			nodestr+=","+nodes[i].data.key;
		else
			nodestr+=nodes[i].data.key;
	}
	$getByName("menuIds",$w.currWinForm()).val(nodestr);
	return $w.doWinForm();
}
</script>
<div class="easyui-panel" data-options="doSize:false,layoutH:47,border:false" style="margin:5px">
		<form method="post" action="/platform/rank/RankGroupPage@update.page" >
			<p:hidden bind="bean.id"/>
			<p:hidden bind="menuIds"/>
			<p:hidden bind="new_"/>
			<div class="ui-formContent">
				<p>
					<label style="width:80px">权限组名称：</label>
					<p:text bind="bean.groupName" style="width:210px" styleClass="required"/>
				</p>
				<p>
					<label style="width:80px">权限组描述：</label>
					<p:text bind="bean.groupDesc" style="width:210px"/>
				</p>
				<div>
					<FIELDSET align=center style="width:92%;">
			        <LEGEND align=left><b>权限菜单</b></LEGEND>
			        <div id="rankgroup_tree" style="background:#ffffff;height:260px;overflow:auto"></div>
			   		</FIELDSET>
				</div>
			</div>
		</form>
</div>
<div class="ui-buttonBar">
	<a href="javascript:;" class="easyui-linkbutton" iconCls="icon_save" onclick="rank_rankgroupok()">保 存</a>
	<a href="javascript:;" class="easyui-linkbutton" iconCls="icon_cancel" onclick="$w.closeCurrWin()">取 消</a>
</div>
<script>
   		$("#rankgroup_tree").dynatree({
			rootVisible: false,
			checkbox: true,
			selectMode: 3,
			initAjax: { 
                url: ctx+"/platform/menu/MenuTreeShowJson.json?rankGroupId="+$getByName("bean.id",$w.currWinForm()).val()
				}
		});
   	</script>